#include <iostream>
using namespace std;

int main()
{
    int t;
    cin >> t;
    while(t--)
    {
        int h;
        cin >> h;
        int cur = 1;
        int times = 0;
        while(h != 0)
        {
            h -= cur;
            if(h % (cur * 2) == 0)
                cur *= 2;
            times += 1;
        }
        cout << times << endl;
    }
    return 0;
}